package com.hotel.controller;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import com.hotel.entity.Order;
import com.hotel.entity.SelectMessage;
import com.hotel.service.OrderInfoService;



//处理用户账户模块的注册、登录和修改

@Controller
@RequestMapping("/order_info")
public class OrderInfoController {
	
	@Resource
	private OrderInfoService orderInfoService;
	
    @ResponseBody
    @RequestMapping(value="/select", method=RequestMethod.POST)  
    public List<Order> typeSelectToPost(@RequestBody SelectMessage selectMessage){
    	
    	List<Order> order = orderInfoService.SelectOrderInfo(selectMessage);
    	return order;
    	
    }  
    
    @ResponseBody
    @RequestMapping(value="/update", method=RequestMethod.POST)  
    public String orderUpdateToPost(@RequestBody Order order){
    	
    	return orderInfoService.updateOrderInfo(order);
    }  
    
    @ResponseBody
    @RequestMapping(value="/evaluate", method=RequestMethod.POST)  
    public String userEvaluateToPost(@RequestBody Order order){
    	
    	return orderInfoService.evaluateOrderInfo(order);
    } 
}
